package cn.getech.data.development.constant;

import lombok.Getter;

@Getter
public enum CodeType {

    UTF8(1 , "UTF-8" ),
    GBK(2 , "GBK" ),
    GB2312(3 , "GB2312" ),
    UTF16(4 , "UTF-16" ),
    ASCII(5 , "ASCII" );
    private  int id;
    private  String  name;
    CodeType(int id , String  name){
        this.id = id;
        this.name = name;
    }

    public static CodeType ObjOf(Integer status) {
        if (status == null) {
            return null;
        } else {
            for (CodeType s : CodeType.values()) {
                if (s.getId() == status) {
                    return s;
                }
            }
            return null;
        }
    }
}
